
#include <iostream>
#include <cstring>
using namespace std;

class Human {
	public:
		Human( int age=0, const char* name="wuming" ) : m_age( age ), m_name( name ){
		
		}
		Human& operator+=( const Human& that ) {
			this->m_age = this->m_age + that.m_age;
			this->m_name = this->m_name+"+"+that.m_name;
			return *this;
		}

		void getInfo( ) {
			cout << "age : " << m_age << endl;
			cout << "name : " << m_name << endl;
		}
	private:
		int m_age;
		string m_name;
};

// designer
// ------------------------------------------------------------------
// user

int main( void ) { 
	Human a( 22, "zhangfei" ), b( 24, "zhaoyun" );
        const Human c( 18, "lily" ), d( 50, "guaangjun" );
	
	a += b;
	a.getInfo( );

	a += c;
	a.getInfo( );

	a += Human( 45, "huangzhuong" );
	a.getInfo( );


	return 0;
}

